import React, { Component } from 'react'
import './05_style.css'
export default class App extends Component {
  // 定义了初始化的状态 --- 先使用后讲解
  state = {
    finished: true
  }
  render() {
    let btnClass = 'btn'
    if (this.state.finished) { // 获取状态 this.state.finished
      btnClass += ' btn-success'
    } else {
      btnClass += ' btn-fail'
    }
    return (
      <div>
        <button className = { btnClass } >按钮</button>
      </div>
    )
  }
}

